<!DOCTYPE html>
  <html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
      <title>title</title>
      <link rel="stylesheet" type="text/css" href="../css/api.css"/>
      <link rel="stylesheet" type="text/css" href="../css/style.css"/>
      <link rel="stylesheet" href="../css/index.css">
      <style>


      header{
        background-color: #03A9F4;
      }
      header ul li {
         height: 50px;
         line-height: 50px;
         text-align: center;
         display: none;
         color: #323237;
         position: relative;
         font-size: 18px;
         color:white;
         border: 0;
            }
      header ul li.active{
         display: block;
        }
      </style>
  </head>
  <body>
    <div id="wrap" class="flex-wrap flex-vertical">
        <header>
            <ul>
                <li class="border-b active" >
                  临检信息详情
                </li>
            </ul>
        </header>
        <div id="main" class="flex-con">

        </div>
    </div>
  </body>
  <script type="text/javascript" src="../script/api.js"></script>


  <script type="text/javascript">
      apiready = function(){

        var data = api.pageParam;
        openFrame(data);

      };
      var openFrame = function (data) {
          api.openFrame({
              name: 'timsgInfo_frm',
              url: './timsgInfo_frm.html',
              rect: {
                  x: 0,
                  y: $api.dom('header').offsetHeight,
                  w: api.winWidth,
                  h: $api.dom('#main').offsetHeight
              },
              pageParam: {
                  data: data
              },
              bounces: true,
              bgColor: 'rgba(0,0,0,0)',
              vScrollBarEnabled: false,
              hScrollBarEnabled: false
          });
      }

      function getPicture(sourceType) {
          if(sourceType==1){ // 拍照
              //获取一张图片
              api.getPicture({
                  sourceType: 'camera',
                  encodingType: 'png',
                  mediaValue: 'pic',
                  allowEdit: false,
                  quality: 90,
                  saveToPhotoAlbum: true
              }, function(ret, err) {
                  // 获取拍照数据并处理
                  if (ret) {
                      var imgSrc = ret.data;
                      if (imgSrc != "") {
                          var ele=$api.dom('#avatar');
                          $api.attr(ele,'src',imgSrc);
                      }
                  }
              });
          }
          else if(sourceType==2){ // 从相机中选择
              //UIMediaScanner 是一个多媒体扫描器，可扫描系统的图片、视频等多媒体资源
              var obj = api.require('UIMediaScanner');
              obj.open({
                  //返回的资源种类,picture（图片）,video（视频）,all（图片和视频）
                  type: 'picture',
                  //（可选项）图片显示的列数，须大于1
                  column: 4,
                  max: 1,
                  //（可选项）图片排序方式,asc（旧->新）,desc（新->旧）
                  sort: {
                      key: 'time',
                      order: 'desc'
                  },
                  //（可选项）模块各部分的文字内容
                  texts: {
                      stateText: '已选择*项',
                      cancelText: '取消',
                      finishText: '完成'
                  },
                  styles: {
                      bg: '#fff',
                      mark: {
                          icon: '',
                          position: 'bottom_right',
                          size: 20
                      },
                      nav: {
                          bg: '#eee',
                          stateColor: '#000',
                          stateSize: 18,
                          cancleBg: 'rgba(0,0,0,0)',
                          cancelColor: '#000',
                          cancelSize: 18,
                          finishBg: 'rgba(0,0,0,0)',
                          finishColor: '#000',
                          finishSize: 18
                      }
                  }
              }, function(ret) {
                  // 获取图片数据并处理
                  if (ret) {
                      if (getJsonObjLength(ret.list) != 0) {
                          var ele=$api.dom('#avatar');
                          $api.attr(ele,'src',ret.list[0].path);
                      }
                  }
              });
          }
      }
  </script>
  </html>
